#给你一个字典，将字典写入到一个txt文件中保存
aa={1:'aaa',2:'bbb',3:'ccc',4:'ddd'}
bb=str(aa)
print(type(bb))
path=r'E:\aaa.txt'
with open(path,'w')as fo:
    fo.write(bb)
    fo.close()

#有一个列表，列表中包含一个字典，取出字典key对应values的值
list1=[{'a':'teacher','b':2,'d':4}]
# print([list2[key] for list2 in list1  for key in list2])
for list2 in list1:
    print(list2)
    for key in list2:
        print(list2[key])




#
# dd="{1:'aa',2:'bb'}"
# cc=eval(dd)
# print(dd)
# print(type(cc))
# #